﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using QldtSdh.BLL;
using QldtSdh.DAL.Models;
using QldtSdh.GUI.Utils;
using QldtSdh.Utils;

namespace QldtSdh.GUI.DaoTao
{
    public partial class FormQuanLyBaoLuu_VaoHocLai_ChiTiet : QldtSdh.GUI.Common.BaseDialog
    {
        HocVien hocVien;
        LopKhoaNganh lop;
        public FormQuanLyBaoLuu_VaoHocLai_ChiTiet(HocVien hocVien, LopKhoaNganh lop)
        {
            InitializeComponent();
            this.hocVien = hocVien;
            this.lop = lop;
            InitInterface();
        }

        void InitInterface()
        {

        }

        bool ValidateData()
        {
            errorNotify.Clear();
            return true;
        }

        private void btnDongY_Click(object sender, EventArgs e)
        {
            if (ValidateData())
            {
                var bl = BizBaoLuu.GetByIDHocVien(hocVien.MaHocVien);
                if (bl == null)
                    DialogResult = System.Windows.Forms.DialogResult.No;
                bl.NgayNhapHocLai = dtVaoHocLai.Value;
                var rs = BizBaoLuu.VaoHocLai(bl, lop.MaLopKhoaNganhGUID);
                if (rs == CODE_RESULT_RETURN.ThanhCong)
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                else
                    DialogResult = System.Windows.Forms.DialogResult.No;
            }
        }

        private void FormQuanLyPhongHoc_ChiTiet_FormClosing(object sender, FormClosingEventArgs e)
        {
        }
    }
}
